<?php
include_once("config.php");
if (isset($_SESSION['adminName'])){
	$isAdmin=true;
}else{
	$isAdmin=false;
}
?>

<!DOCTYPE html>
<html>
<head>
	<title>Index | Admin</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css">
	<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
	<script type="text/javascript" src="//netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"></script>
</head>
<body>
<?php
if (!$isAdmin){
?>
	<div class="jumbotron">
		<div class="container">
	  	<form class="form-horizontal" role="form" action="checkLogin.php" method="post">
			  <div class="form-group">
			    <label for="inputEmail3" class="col-sm-2 control-label">Admin</label>
			    <div class="col-sm-10">
			      <input type="text" class="form-control" name="adminName" placeholder="Admin Username">
			    </div>
			  </div>
			  <div class="form-group">
			    <label for="inputPassword3" class="col-sm-2 control-label">Password</label>
			    <div class="col-sm-10">
			      <input type="password" class="form-control" name="adminPassword" placeholder="Admin Password">
			    </div>
			  </div>
			  <div class="form-group">
			    <div class="col-sm-offset-2 col-sm-10">
			      <button type="submit" class="btn btn-default">Login</button>
			    </div>
			  </div>
			</form>
		</div>
  </div>
<?php
}else{
  header("location: adminIndex.php");
}
?>
</body>
</html>

